#!/usr/bin/env python3
# -*- coding: utf-8 -*-



from flask import Blueprint,session,redirect,url_for

from ..secure import login_required


bp = Blueprint('logout', __name__, url_prefix="/logout")

# @login_required
@bp.route('/logout', methods=["POST","GET"])
def logout():
    '''视图-注销'''
    # 移除session
    session.pop('user', None)
    # 跳转到登录页面
    return redirect(url_for('login.login'))